package com.wy;

import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
import java.io.File;

public class ImageToTextConverter {
    public static void main(String[] args) {
        File imageFile = new File("E:\\workspace_Wy\\temp\\1.png");
        Tesseract tesseract = new Tesseract();

        try {
            String result = tesseract.doOCR(imageFile);
            System.out.println(result);
        } catch (Exception e) {
            System.out.println("有错误");
            System.err.println(e.getMessage());
        }
    }
}
